package com.ponhu.ea2.stockcenter.provider.service.entity;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ponhu.ea2.stockcenter.dto.WMSInventoryInfo;
import com.ponhu.ea2.stockcenter.enums.ExchangeActionTypeEnum;
import com.ponhu.ea2.stockcenter.provider.entity.StockInventoryReal;

import java.util.List;
import java.util.Collection;

/**
 * 销售库存表服务类
 */
public interface StockInventoryRealService extends IService<StockInventoryReal> {

    /**
     * 根据货品编码列表查询实物类货品数据(如果未查询到，那么从商品中心查询并创建，初始化库存数为0)
     *
     * @param inventoryCodeList
     * @return
     */
    List<StockInventoryReal> getRealInventoryStockListIfNullCreate(Collection<String> inventoryCodeList);

    /**
     * 根据货品编码列表查询实物类货品数据
     *
     * @param inventoryCodeList
     * @return
     */
    List<StockInventoryReal> getRealInventoryStockList(Collection<String> inventoryCodeList);

    /**
     * 创建并初始化库存
     *
     * @param goodsId
     * @param inventoryId
     * @param inventoryCode
     * @param stockNumber
     * @return
     */
    boolean createAndInitStockData(Long goodsId, Long inventoryId, String inventoryCode, int stockNumber);

    /**
     * 修改货品在途库存数量
     *
     * @param inventoryInfoList
     * @param actionType
     * @return
     */
    boolean updateFreeStockNum(List<WMSInventoryInfo> inventoryInfoList, ExchangeActionTypeEnum actionType);

}
